<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
//var s = "asl345803480&&)()_%%jflji003i99JJ**(&&&JLllfdkflAAAljlb";

// replace
/*var s1 = s.replace(/\d/gi, "")
console.log(s1);*/
//console.log(s.replace(/\W/gi, ""));
var s = "今今今天天天我要要请请你们喝喝凉水";

var s1 = s.replace(/(.)\1+/gi, "$1");  //
//console.log(s.match(/(.)\1+/gi));
console.log(s1);

// 把字符中所有的这样结构的字符串取出来:  xyx
var s = "aaabaljlacabab你好你我啊我daad"
console.log(s.match(/(.)(.)\1/gi));

// split  切割
var s = "10sfjl2lfjlkj3lksdfjl200";
console.log(s.split(/\D+/gi, 5));  // 参数2:切出来的数组的最大长度
//console.log(s.match(/\d+/gi));

</script>
</body>
</html>